package com.bamboo.framework.framework.security.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 菜单表
 * </p>
 *
 * @author 郭晴
 * @since 2018-12-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Menu extends Model<Menu> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 菜单路由
     */
    private String url;
    /**
     * 图标
     */
    private String icon;

    /**
     * 描述
     */
    private String description;

    /**
     * 顺序
     */
    private Integer level;

    /**
     * 可用标识(0不可用,1可用)
     */
    private String flag;

    /**
     * 标题
     */
    private String title;

    /**
     *父级id
     */
    private Integer parentId;

    /**
     * 下级菜单集合
     */
    @TableField(exist = false)
    private List<Menu> menus;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
